/*************************************************************************
 *************************************************************************
 	 	 	 	 	 	 	M2SMA : DWPhysicAgent.h
 *************************************************************************
 *
 	 Copyright (C) 2011
 	 DW-2011, Steven Costiou, Youenn Corre, France
 *
 **************************************************************************
 **************************************************************************
 *
	//TODO FILE COMMENT
 *
 **************************************************************************
 **************************************************************************
 *
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/
 *
 **************************************************************************
 **************************************************************************/

#ifndef DWPHYSICAGENT_H_
#define DWPHYSICAGENT_H_

#include "DWGraphicAgent.h"

class DWPhysicAgent : public Agent
{
	public:

		DWPhysicAgent(Engine* parentEngine);
		~DWPhysicAgent();

		/**
		 * Tells whether or not there is a bounding box collision between two rectangles.
		 */
		bool computeBoundingBoxCollision(SDL_Rect aBox, SDL_Rect anOtherBox);

		/**
		 * Tells whether or not there is a pixel perfect collision between two displayed surfaces.
		 * This test is performed only in case there is a bounding box collision detected already.
		 */
		bool computePixelPerfectCollision(SDL_Surface aSurface, SDL_Surface anOtherSurface);

		/**
		 * Performs a full collision detection test between two displayed graphic agents.
		 */
		bool performCollisionDetectionAlgorithm(DWGraphicAgent* aDWGraphicAgent, DWGraphicAgent* anOtherDWGraphicAgent);

		virtual void live();

	private:
		DWPhysicAgent(const DWPhysicAgent& aDWPhysicAgent);

	private:

		int overTop;
		int overBottom;
		int overLeft;
		int overRight;
};

#endif /* DWPHYSICAGENT_H_ */
